{extend name="layout/layout" /}

{block name="pagecss"}
<style>
	table.dataTable.no-footer {
		border-bottom: 0 !important;
	}
	#data-table_processing {
		border: 0 !important;
		position: relative;
	}
</style>
<link href="__STATIC__/admin/pages/css/product.css" rel="stylesheet" type="text/css" />
<link href="__STATIC__/plugins/umeditor/umeditor.min.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="row js-check-wrap">
	<div class="col-lg-12">
		<div class="box box-success">
			<div class="box-header with-border">
				<div class="row">
					<div class="col-md-9">
						<form id="searchForm" class="form">
							<div class="form-inline">
								<label>商品分类 ：</label>
								<select name="typeId" class="form-control ">
									<option value="0" selected>商品分类</option>
									{volist name="type" id="vo"}
									<option value="{$vo.id}"><span>{$vo.name}</span></option>
									{/volist}
								</select>
								&nbsp;&nbsp;&nbsp;

								<label>商品名称 ：</label>
								<input type="text" class="form-control" name="title" placeholder="商品名称" maxlength="44">
								&nbsp;&nbsp;&nbsp;

								<input type="hidden" class="form-control isActive" name="isActive">
								<button type="button" class="btn btn-success" id="doQuery" title="搜索">
									<i class="fa fa-search"></i> 搜索
								</button>
							</div>
						</form>
					</div>
				</div>
				<div class="box-tools pull-right">
					<button class="btn btn-primary btn-sm" id="btn_new_role" onclick="ajaxType('')"><i class="fa fa-plus"></i> 新增商品</button>
					<button class="btn bg-navy btn-sm" id="btn_new_ptype" onclick="addType('')"><i class="fa fa-plus"></i> 设置商品类目</button>
				</div>
			</div>
			<div class="box-body ">
				<form class="js-ajax-form" method="post">
					<div class="table-responsive">
						<table class="table table-striped table-bordered table-hover table-checkable order-column" id="product_table">
							<thead>
							<tr>
								<th> 缩略图 </th>
								<th> 商品名称 </th>
								<th> 分类 </th>
								<th> 现价(元) </th>
								<th> 会员价(元) </th>
								<th> 更新时间 </th>
								<th> 操作 </th>
							</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<!-- 弹框  商品分类-->
<div class="modal fade ban-typelist" id="" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
				<h4 class="modal-title">设置商品分类页面</h4>
			</div>
			<div class="modal-body">
				<div class="form-horizontal">
					<button type="button" class="btn btn-primary" id="addType" >新增分类</button>
					<span class="help-block text-center" style="color: red"></span>
				</div>
				<table class="table" id="productType_table">
					<thead>
					<tr>
						<th>商品分类</th>
						<th>排序</th>
						<th>创建时间</th>
						<th class="text-right">操作</th>
					</tr>
					</thead>
				</table>
			</div>
		</div>
	</div>
</div>

<input type="hidden" class="datalist_url" value="{:url('admin/member/getMemberList')}">
<input type="hidden" class="view_url" value="{:url('admin/member/view')}">
{/block}

{block name="pagescript"}
<script>
    var plist_url = "{:url('admin/product/indexApi')}";   //商品列表接口
    var productAdd_url = "{:url('admin/product/addProduct')}";   //添加商品
    var productEdit_url = "{:url('admin/product/editProduct')}";   //编辑商品
    var productDel_url = "{:url('admin/product/deleteProduct')}";

    var typeAdd_url = "{:url('admin/product/addType')}";   //添加商品分类
    var typeList_url = "{:url('admin/product/getTypeApi')}";  //商品分类列表
    var typeSave_url = "{:url('admin/product/typeSave')}";  //商品分类保存接口
    var typeDel_url = "{:url('admin/product/typeDel')}";   //商品分类删除接口

    var checkStore = "{:url('admin/product/checkStore')}";
    var store_add = "{:url('admin/store/add')}";
    var is_tdt = "{$is_tdt}";
</script>
<script src="__STATIC__/admin/js/include.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/product.js" type="text/javascript"></script>
{/block}